package com.ruslan.magaz.service;


import java.util.Collection;
import java.util.Comparator;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.TreeSet;

import com.ruslan.magaz.domain.Cart;
import com.ruslan.magaz.domain.Category;
import com.ruslan.magaz.domain.Order;
import com.ruslan.magaz.domain.OrderedItem;
import com.ruslan.magaz.domain.Product;
import com.ruslan.magaz.domain.Rating;

public interface ItemService {
	boolean updateCart(Cart cart);
	Product getProductById(int id);
	void addProduct(Product product);
//	void removeProduct(Product product);
	void editProduct(Product product);
	void deepEditProduct(Product product);
	List<Product> getAllProductsForCategory(int categoryId, int pageNum, int pageSize);
	int productsForCategoryPageCount(int categoryId, int pageSize);
	Integer getFirstCategoryId();
	List<Rating> getAllReviewsForProduct(int productId, int pageNum, int pageSize);
	int reviewsForProductPageCount(int productId, int pageSize);
//	List<Product> getAllProductsForSpecificationValue(int SpecifiationId, )
	double getAvgRating(int productId);
	int countRaters(int productId);
	Category getCategoryByName(String name);
	void addCategory(Category category);
	void editCategory(Category category);
	Category getCategoryById(int categoryId);
	void removeCategory(int categoryId);
	List<Category> getAllCategories();
	List<Category> getAllCategories(int pageNum, int pageSize);
	List<String> getCategoryNames();
	int categoriesPageCount(int pageSize);
//	List<Category> getAllChildCategories(Category parent);
	Rating getRatingForUserNItem(int userId,int itemId);
	void addRating(Rating rating);
//	void addReview(Review review);
	void editRating(Rating rating);
//	void editReview(Review review);
	List<OrderedItem> getOrderedItemsFromCart(Order order, Map<Integer, Integer> productMap);
	Map<Integer, Integer> getCartFromOrder(Order order);
	Set<Rating> sortRatings(Collection<Rating> ratings);
	int getCountForProductId(int productId);
	void moveProductsFromCategory(int fromId, int toId);
	int countItemsInCategory(int categoryId);
	
}

